﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace 动画
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void grid_MouseMove(object sender, MouseEventArgs e)
        {

        }

        private void grid_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Point mousePoint = e.GetPosition(grid);
            ScaleTransform scaleTransform = ellipse.RenderTransform as ScaleTransform;
            DoubleAnimation scaleDoubleAnimation = new DoubleAnimation()
            {
                To = (mousePoint.X + mousePoint.Y) / 200,
                Duration = new TimeSpan(0, 0, 0, 0, 250),
            };
            scaleTransform.BeginAnimation(ScaleTransform.ScaleXProperty, scaleDoubleAnimation);
            scaleTransform.BeginAnimation(ScaleTransform.ScaleYProperty, scaleDoubleAnimation);
        }
    }
}